home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-serious-
/
wb
/
merlin
/
docs
/
merlin.doc
< prev
next >
Wrap
Text File
|
1999-07-12
|
37KB
|
1,137 lines
Copyright (C) 1998-1999 by Arend-Paul Spijkermann
Software and documentation written by A.Paul Spijkerman
All Rights Reserved
All information in this documentation
is subject to change without prior notice
Project Merlin
==============
The Merlin project is a number of programs i have written
to configure my system as I would like it to be.
An easy way to generate a GUI for your system.
It consists of the Master Control Program and its server,
the scheduler, the soundhandler, a number of programs
to generate GUI's for directorys and drives and
programs to start it.
There are more elements, but they are not included yet.
You can make a Popup MenuButton window with it.
Make a Browser type of workbench with it and
Emulate workbench or windows with it.
Use your creativity and make your Amiga into YOUR Amiga.
(These are not hacks, it is a layer upon the OS)
The system works on any Amiga witk OS 2.0 or better.
It needs no external products, it only uses a couple
of the most basic libraries and is very portable.
Ever downloaded a "menu button" popup tool and was
disapointed about the lack of options.
Because you couldn't do simple things like group buttons
by coloring them or draw a border around them.
Have you ever wondered why you can't control your system
with a nice GUI like your favourite aplications ?
Ever wanted to add a "Start" button to your system ?
Ever wanted to setup an easy GUI for someone who
doesn't know much about computers with only the
applications the need. And a password secured icon
for the system operator to start an editor or something.
Ever wanted to make a multi-user workbench ?
With or without password control ?
Ever wanted to make a special "brag" workbench, or a
workbench with your favourite pictures.
Which you can take with you on disk ?
This is not a Workbench replacement but a system to make
a GUI to your system as YOU see it, a sort of BrowserBench.
You can group buttons without having to move programs to
other harddisks or CDroms.
Configuration is easy. You don't have to give the position
of all elements. Just how they are orientated to the other
elements. This is done by placing them in horizontal or
vertical groups.
When you want to make 3 columns with 3 buttons you first have
to make a horizontal group for the rows of columns. And inside
that you have 3 vertical groups for the buttons.
It would look like something like this:
(Note that the indentations are only there to show the structure)
HGROUP
VGROUP
TEXT "Games"
BUTTON "Game1" RUN "dh1:games/game1"
BUTTON "Game2" RUN "dh1:games/game1"
BUTTON "Game3" RUN "dh1:games/game1"
ENDGROUP
VGROUP
TEXT "Utils"
BUTTON "Dirwork" RUN "dh1:utils/DirWork"
BUTTON "Edit" RUN "dh1:utils/Editor"
BUTTON "ARTM" RUN "dh1:utils/ARTM"
ENDGROUP
VGROUP
TEXT "Internet"
BUTTON "Browser" RUN "dh1:Inet/Browser"
BUTTON "Mail" RUN "dh1:Inet/Mail"
BUTTON "Irc" RUN "dh1:Inet/Irc"
ENDGROUP
ENDGROUP
Because no position is fixed things like resizing a window
is easy to implement. When you resize a window the engine
recalculates all positions. Also lists will show more
lines if there is more room after a resize.
Even better you can specify things like line thickness and the
distances between objects and groups. So you can change the
looks to your licking.
Every object can have its own font and colors.
It is Based on ASCII type readable and editable description
files for GUI's .. GUI files can be generated by
some of the suplied programs.
You are not limited to just buttons or text objects, there
are Clickable pictures with dithering, animations,
clocks, lists with scrollers, lines etc.
There are programs suplied to make windows with Icons
for drives, and windows with icons for programs.
This is all done real time with scripts.
Also these programs can recognize the types of files,
so you can even display pictures by clicking on icons.
The best thing is you can browse through directories
where files have no icons.
If you click on a directory Icon a GUI file for that
directory is made by a script and the script executes
a GUI-browser for that GUI-file.
But there are more interesting features.
Objects of GUI's can be changed by Arexx scripts
or external programs.
Or even better you can use the system as a GUI
for you arexx program.
Say you wanted to add a currency conversion system
in the corner of your GUI.
Or you want to convert Degrees Fahrenheit to
degrees celsius or vice versa on your GUI.
All you need is the folowing pieces of GUI definition
in your GUI file, and the arexx scripts in the rexx directory.
VGROUP
HGROUP
TEXT "HFl. "
STRINGGADGET SIZE 10 ID 11 run "rx mcp:rexx/GuilderToEuro.rexx %n"
ENDGROUP
HGROUP
TEXT "Euros"
STRINGGADGET SIZE 10 ID 12 run "rx mcp:rexx/EuroToGuilder.rexx %n"
ENDGROUP
ENDGROUP
VGROUP border
HGROUP
TEXT "F" SIZE 1
STRINGGADGET SIZE 6 ID 13 run "rx mcp:rexx/FahrenheitToCelsius.rexx %n"
ENDGROUP
HGROUP
TEXT "C" SIZE 1
STRINGGADGET SIZE 6 ID 14 run "rx mcp:rexx/CelsiusToFahrenheit.rexx %n"
ENDGROUP
ENDGROUP
And how about a Stop button to shut the system down.
You probably say a stop button isn't that a silly
shortcoming of the system ??
But wait, what about the Editors on other windows you forgot
about when you turn the system off. Or files stored in RAM:
Won't programs needs special adaptation to stop and save
on demand ?.
Well some do. But we have Arexx, how about an arexx script
that saves the current text in a Cygnus editor with a
".TMP" extension.
Like a reversed startup-sequence.
Wouldn't a software controlled On/Off button be usefull ?
You press the Off button, all the programs finish and then
the power is switched off.
Say you don't play games, then you have a button on the
joystick you don't use. What about an option to shut the
system down when you press it as a sort of Soft Off.
Just stick it next to the On/Off switch, and press it
before you switch off.
Sound silly ? Wait untill it saves your document.
Or what about a lightning storm, you want to switch
off the system quick not close all programs by hand.
Have you ever tried to instruct family how to stop all programs.
Do you have an Uninterruptable PowerSuply that powers your system
a couple of minutes at power failures ?
What if you are away when the power fails.
Just wire the warning signal to the joystick button.
Are you afraid it might fry your joystick port ?
Just buy an OptoCoupler for a few dollars and solder it
between joystick and UIP wires.
An OptoCoupler is a galvanic separation device, it is basically
a tiny cube with a LED light and a light sensitive switch, all
PC Power suplies have them.
You could mount it in a little box with a OFF push button on it.
Using the system
================
First time use:
To use the provided demonstration archive, you only
need to unarchive it to a directory.
Make an assign MCP: to the directory, like:
Assign MCP: RAM:
And execute the "Start" script by typing "MCP:Start".
If the script lost its script flag while unarchiving
you need to add "execute" or give the script the
script flag with "protect MCP:start +S".
The system can be stopped by clicking the Quit button
or starting the "Stop" script.
The Merlin Project Server
=========================
Note that there is a ScreenGrab in the main directory.
To be able to use the MCP programs first you need to
start the server program "MPS".
The program is needed for a number of reasons.
It manages the Public Screen if it is needed.
It provides Merlin Project tasks with unique
identification numbers.
It handles shared data.
It stops all programs when the system is quited.
etc..
This program makes use of the "mcp:cfg/screen.mps"
file where the definitions are.
Here you can define if the GUI's use the workbench
screen or a special Public Screen is opend.
Just start MPS with "Run MPS".
The Master Control Program (or MCP).
====================================
This program handles the GUI's.
Just run it with the name of the GUI file on the
commandline but don't add the ".mcp" extension.
Master Control Program configuration files
------------------------------------------
For every GUI you need a to make a configuration file.
The contents of these files can be split into two
kinds of data.
The first half describes general parameters and defines
labels and such things.
The second half describes the objects of the GUI and how
they are placed in the GUI.
It is best to place the items of the first catagorie in
the first part (begining) of the configuration file
because some of the items can only be used after they
are mentioned. Like the labels.
Lets call the first part of the configuration file with
items of the first categorie the "header". And the second
part the "Gui definition".
Configurations are line based.
This means that a line can be empty or it contains the
data of one item or object.
Data of an object can't be on more then one line.
When spaces need to be used in definitions then place the
entry between "" characters.
A good practice would be to place all text which are not
keywords between "".
Comments can be made every where in the configuration by
placing a ; after the last relevant data of a line
and placing the comment after the ; character.
The Header part
--------------
To make the Gui definition more readable you can define labels
for pens. This means you can use the names of colors instead
of pen numbers. This is optional.
In GUI files generated by programs this option is not used.
The template for pen labels is "PEN #nn label"
Examples:
PEN #0 Grey
PEN #1 Black
PEN #2 White
PEN #3 Blue
Also there are labels for fonts, this means you can make
a label for each type of object.
If you want to change the font used by buttons you only need
to change the definition of the label instead of changing
the font in each button definition.
The template is "FONT "Fontname.font" FontSize Label"
Examples:
FONT "Topaz.font" 8 ButtonFont
FONT "Topaz.font" 8 TextFont
Also there labels for the definition of pictures.
This is usefull if a picture is used many times like
by the mdir program that turns the contents of a directory
in a GUI with icons.
Note that only the IFF type of pictures are recognized.
Note that 24bit type of IFF's can be used.
The template is "IFF "path/picture.iff" Label"
Examples:
IFF "mcp:iff/dir.iff" dirPic
IFF "mcp:iff/doc.iff" docPic
IFF "mcp:iff/exe.iff" exePic
IFF "mcp:iff/arc.iff" arcPic
IFF "mcp:iff/pic.iff" picPic
IFF "mcp:iff/dat.iff" datPic
IFF "mcp:iff/snd.iff" sndPic
Line thickness of objects and the number of pixels between
certain types of objects can be controlled.
For this there are 4 item types which can each be
defined once in a configuration file.
These keywords are follow by two parameters who correspond
with number of pixels in the X and the Y direction.
Available items are:
SAW X Y
SAG X Y
SAO X Y
LTX X Y
SAW means Space Around Window
SAG means Space Around Group
SAO means Space Around Object
LTX means Line thickness
The "Space Around Window" is the numbers of pixels on the
inside edge of a window that is left empty.
The "Space Around Group" is the space in numbers of pixels that is
created at the inside AND the outside of the border of a group
of objects.
The "Space Around Object" is the space in numbers of pixels that is
left empty around an object.
The "Line Thickness" is the thickness of lines in pixels that
is used for all borders and line objects.
Examples:
SAW 2 1 ; SpaceAroundWindow X Y
SAG 3 2 ; SpaceAroundGroup X Y
SAO 2 1 ; SpaceAroundObject X Y
LTX 2 1 ; LineThickness X Y
The default size of buttons and strings can be defined with
one line.
This is usefull if a GUI contains a lot of buttons of the
same size. You don't need to specify the size for each object.
Template: "DEFAULTSIZE nnn"
Example:
DEFAULTSIZE 10
The background color of a window can be defined.
Note that the background is only colored if the pen
definition is different as the default color of the
window. This can be the case if a color is translated
to a pen with the same color as the window, if the
number of pens is smaller as the number or pens used in
the configuration.
Note that this is best used AFTER the pen labels.
Template: "WINDOWCOLOR nnn/label"
Examples:
WINDOWCOLOR grey
WINDOWCOLOR 3
The title of a window can be changed.
Note that if you use spaces you need to use "".
Template: "WINDOWTITLE "string of text""
Example:
WINDOWTITLE "Main"
The MCP system optionally stores the last position and size
of GUI windows. If you want to use this you need to put
the SAVEWINDOWPOS in the header.
The data is saved for each GUI in the mcp:temp/ directory.
Template: "SAVEWINDOWPOS"
You can define the position of where the window is opened on
the screen.
Note that this can be overruled if there is saved window
size and position available.
Template: "WINDOWPOS X Y"
Example:
WINDOWPOS 20 20
After the GUI is completely drawn a program can be
optionally started.
This can for example be a program that changes some
of the GUI objects or fills the lists.
Template: "DEFAULTPROG "Path/program %x""
Example:
DEFAULTPROG "mcp:rexx/main.rexx %n" ;%n=port number, %s=prog name
Note that there are some variables that can be used that are
filled in by the system at the moment of use.
These variables work exactly like in those in programs written
in the C language.
%n is an integer which is the "number" of this program
This number is needed when the program want to
interface with
%s is a string with the name of the GUI (the config name with
the path and .mcp part)
%i is the ID number of the object, in case of the Defaultprog
it is 1, because objects with the ID number not defined
give the value 0 as result.
This is usefull in case you make one script for all the
RUN calls of a GUI, so you only have to mention an ID once
so you can't have a wrong ID on a command line.
The Gui definition part
-----------------------
Note that if you want to change or read a GUI object
with an external program you will need to give the
object an ID number. This is a 32 bit unsigned number.
This number needs to be unique in a GUI configuration file.
(Unless you want to use duplicate objects)
If you want to use the same Arexx scripts in different
GUI's you need to keep the ID's unique through the system.
This means if you use ID 12 for a stringgadget where you
can enter the temperature in degrees celsius you can beter
not use ID 12 in other configs for other types of objects.
Configuration is easy. You don't have to give the position
of all elements. Just how they are orientated to the other
elements. This is done by placing them in horizontal or
vertical groups.
This part of the configuration basically consists of
nested groups with GUI objects in them.
When you want to make 3 columns with 3 buttons you first have
to make a horizontal group for the rows of columns. And inside
that you have 3 vertical groups for the buttons.
It would look like something like this:
(Note that the indentations are only there to show the structure,
config files are better readable if you enter them this way)
HGROUP
VGROUP
TEXT "Games"
BUTTON "Game1" RUN "dh1:games/game1"
BUTTON "Game2" RUN "dh1:games/game1"
BUTTON "Game3" RUN "dh1:games/game1"
ENDGROUP
VGROUP
TEXT "Utils"
BUTTON "Dirwork" RUN "dh1:utils/DirWork"
BUTTON "Edit" RUN "dh1:utils/Editor"
BUTTON "ARTM" RUN "dh1:utils/ARTM"
ENDGROUP
VGROUP
TEXT "Internet"
BUTTON "Browser" RUN "dh1:Inet/Browser"
BUTTON "Mail" RUN "dh1:Inet/Mail"
BUTTON "Irc" RUN "dh1:Inet/Irc"
ENDGROUP
ENDGROUP
This might look complicated, but if you know how your
GUI is gonna look like it is very simple.
You need to remember that all objects need to be
arranged in horizontal and vertical groups.
Just draw your GUI on a piece of paper and draw boxes
around horizontal and vertical groups of objects.
Then draw boxes on the horizontal and vertically arranged
groups until the biggest box is the window itself.
Then start to write down the information of the biggest
box and then write down the information of the objects
inside the box.
You always need to start the gui configuration with
a HGROUP or VGROUP object.
Useable Objects
---------------
Horizontal and vertical groups.
Groups can have optional borders.
These are just the HGROUP and VGROUP keyword followed by
options:
note: Groups MUST be terminated with ENDGROUP
HGROUP, VGROUP
Example:
HGROUP BORDERUP BCOLOR lgrey
options:
BORDER, GROOVE <- Draws a 2D groove around a group
RIDGE <- Draws a 2D ridge around a group
BORDERUP, UP <- Gives the group a 3D "UP" look
BORDERDOWN, DOWN <- Gives the group a 3D "Down" look
BCOLOR <label>/<color> <- Changes the background color of the group
Text objects.
These are a line of text, with an optional border.
Note that the text must come after the TEXT keyword.
TEXT "text"
Example:
Text "test" BCOLOR blue BOLD
options:
BORDER, GROOVE <- Draws a 2D groove around a group
RIDGE <- Draws a 2D ridge around a group
BORDERUP, UP <- Gives the text a 3D "UP" look
BORDERDOWN, DOWN <- Gives the text a 3D "Down" look
BORDERINV, INV <- Invisible border, makes object bigger
<FontLabel> <- Defines the font to be used
BCOLOR label/nr <- Defines the background color
FCOLOR label/nr <- Defines the character color
CLOCK <- turns this object in a clock
ITALIC, BOLD, UNDER <- changes font style
SHADOW <- draws a black shadow under characters
SHADOW2 <- draws a further shadow (can be combined with SHADOW)
SIZE nnn <- Length of the object in characters
ID nn <- Identification number
Button objects.
These are button gadgets that start programs when clicked on.
Note that the text must come after the BUTTON keyword.
BUTTON "text"
Example:
BUTTON "Test" ID 123 BCOLOR blue FCOLOR black RUN "Test"
options:
<Font> <- label of the font to be used (optional)
ID nnn <- identification number
BCOLOR label/nr <- Defines the background color
FCOLOR label/nr <- Defines the character color
RUN "path/program %n" <- program to run (%n = node number, %i = ID)
STACK nnn <- If you need more stack then 4096 bytes
SIZE nnn <- Length of the object in characters
QUIT <- Quits program if clicked
QuitButton object.
These are button gadgets that quit the program when clicked on.
QUITBUTTON
options:
<font> <- label of the font to be used (optional)
SIZE nn <- Length of the object in characters
CheckMark object.
These are button gadgets that can be toggled and read by
external programs.
CHECKMARK
options:
<font> <- label of the font to be used (optional)
BCOLOR label/nr <- Defines the background color
FCOLOR label/nr <- Defines the character color
STATE 0/1 <- Default state of the CheckMark object
ID nnn <- Identification number
Picture object.
These are pictures loaded from IFF files and converted to
the screen depending on the pens available.
Note that a program can be started when a picture is clicked on.
Note that there a couple of dither modes.
Dither mode 1 is for pictures with no color change from pixel to pixel
Dither mode 2 is for pictures of persons with color change.
Note that in HAM or GREY modes only always mode 2 is used.
PICTURE
Example:
PICTURE boing BORDERUP
Options:
<label> <- label of the picture to be used
BORDER, GROOVE <- Draws a 2D groove around a picture
RIDGE <- Draws a 2D ridge around a picture
BORDERUP, UP <- Draws a 3D "up" border around a picture
BORDERDOWN, DOWN <- Draws a 3D "up" border around a picture
RUN "path/program %n" <- program to run (%n = node number, %i = ID)
STACK nnn <- If you need more stack then 4096 bytes
DITHER nn <- Optional dither modes
StringGadget object.
These are text gadgets that can be filled with text that can
be read by external programs.
The program is started when return is pressed in the gadget.
STRINGGADGET
Options:
<Font> <- label of the font to be used (optional)
SIZE nnn <- Length of the object in characters
ID nnn <- Identification number
RUN "Path/file %n" <- program to run (%n = node number, %i = ID)
STACK nnn <- If you need more stack then 4096 bytes
BCOLOR label/nr <- Defines the background color
FCOLOR label/nr <- Defines the hand color
Doscommand object.
This is a string gadget that will try to execute the
string of text that is in it when return is pressed.
DOSCOMMAND
Options:
<Font> <- label of the font to be used (optional)
SIZE nnn <- Length of the object in characters
BCOLOR label/nr <- Defines the background color
FCOLOR label/nr <- Defines the hand color
Animation Object.
This is a little box with a moving "hand" to show the computer
still works. Might be nice if your a programmer.
ANIM
Options:
BCOLOR label/nr <- Defines the background color
FCOLOR label/nr <- Defines the hand color
Line Object.
This is supposed to be a separation line between objects
or groups of objects. Works best if a horizontal line is
used in a vertical group and vice versa.
The line will be almost as wide as the group it will draw in.
LINE
Options:
HORIZONTAL <- Switch to draw a horizontal line
VERTIKAL <- Switch to draw a vertical line
Void object.
Defines a piece of space.
Usefull if you want a gap between objects.
You make make colored boxes with it if it is the only
object in a colored group. (see the colortest.mcp)
VOID
Options:
HORIZONTAL <- Only gives the object width
VERTIKAL <- Only gives the object height
SOLID <- Gives both width and Height
WIDTH nnn <- define width in pixels
HEIGHT nnn <- define height in pixels
List object.
Defines a list with a scroller.
Objects that are clicked on are executed.
Note that lists can be "loaded" in different ways.
Methode one is giving it the name of a file with the list in it.
The file would have the following format: TEXT ".." RUN "path/prog"
Where TEXT is the text visible text, and RUN the program executed.
The other methode to load a list is by an external program or script
That is executed by a button or the DefaultProg option.
Note that SMODE is the way a list behaves optionally when it is clicked.
0 = nothing
1 = selected entry flashes
2 = single selected items are shown hilighted (default)
3 = multi selected items are shown hiligthed
Note that AMODE is the action a list performes when it is clicked.
0 = no action (For instance when the selected items are read by arexx)
1 = execute the RUN string of the selected item (default)
LIST
Options:
BORDER, GROOVE <- Draws a 2D groove around a group
RIDGE <- Draws a 2D ridge around a group
BORDERUP, UP <- Gives the text a 3D "UP" look
BORDERDOWN, DOWN <- Gives the text a 3D "Down" look
BCOLOR label/nr <- Defines the background color
FCOLOR label/nr <- Defines the character color
SCOLOR label/nr <- Defines the background color of selected items
<Font> <- label of the font to be used (optional)
ID nnn <- Identification number
SIZE nnn <- width of the list in characters
LINES nnn <- heigth of the list in lines
SMODE nnn <- selection mode
AMODE nnn <- action mode
LISTFILE "path/file" <- file to load entries from
Clock object.
Shows the time in 24 hour format.
CLOCK
Options:
BCOLOR label/nr <- Defines the background color
FCOLOR label/nr <- Defines the character color
ITALIC, UNDER, BOLD <- Defines font styles
BORDER, GROOVE <- Draws a groove around a group
BORDERUP, UP <- Gives the text a 3D "UP" look
BORDERDOWN, DOWN <- Gives the text a 3D "Down" look
BORDERINV, INV <- Invisible border, makes object bigger
<FontLabel> <- Defines the font to be used
Interaction of MCP with other programs
--------------------------------------
When MCP is started or on object is accessed a program
can be executed.
These programs can interact with MCP to read data from
certain objects or to change certain objects.
This can be done through the Arexx port or the program message port.
The Arexx port makes it possible to use extra commands in
arexx scripts.
The program message port allows programs in a higher language to
interact with MCP.
An example of such a program is the McpMsg program, which can
do about all the things the arexx commands can do.
The McpMsg program can be used in DOS scripts to change the
GUI .. or be started from programs with an option to
execute programs.
I have looked if there are options to do this from REBOL
but have found none so far....
If you start an arexx script you need to use %n at the
end of the command line so the script knows which
arexx port to access.
You need to add something like the folowing to your
scripts so it uses the correct arexx port:
Arg node_number /* node we were run from */
Host = 'MCPREXX.'node_number /* the Trion MCP Arexx port */
Options results
Address value host
options failat 15
/* say "node: "node_number */
if node_number = "" then do
say "error .. rexx script not started with %n on command line"
exit 1
end
When you start a DOS script you also need to add the %n at
the end of the command line.
The script needs a couple of lines to read the number.
A script to change a text can look something like this:
.key number
.def number="1"
mcp:bin/McpMsg NODE <number> WRITESTRING ID 1 STRING "Text"
Arexx script can not only be used to change some objects on
in the GUI, you can use MCP as a GUI to your Arexx scripts..
Especially for this each copy of the MCP program has
registers that are kept in memory even if there is no
script running at the time.
Each program has 40 registers that are 32 bit deep unsigned.
In a normal program you would "Wait()" until there is
input for your program. And while you wait all the
variable hold the state of your program.
With MCP the register hold the state of your program.
Your program can consist of a number of arexx scripts,
a script for each object accessed.
Or you could make a big program and start the program for
each object with the ID number of the object on the command
line. Then the program needs to figure out what to do
for each object. You might want to use the %i code on the
end of the command line for the ID number, so you can't
have a wrong ID when you changed the ID field.
Look at the rexx/list.rexx script for an example of this.
Earlier in the document there is a description of how to
make a system that converts currency's or Degrees fahrenheit
to celsius and reverse. The scripts for this can be
found in directory "mcp:rexx/".
Other possibilities could be to count the number of clicks of
a button in a register.
You could make a Volume control with 2 buttons, and 2 scripts
that use a register and execute the SndEvent program.
Available commands
------------------
GET and SET register commands
With these commands the registers can be changed and read.
There are 40 registers, each 32 bits wide and unsigned.
Arexx template: SetReg "REG/N/A,VALUE/N"
Arexx template: GetReg "REG/N/A"
Examples:
write value 123 to register 6
SetReg "Reg 6 Value 123"
SetReg "6 123"
print the contents of register 6 and 7
GetReg "6"
reg6 = result
Say "Register6="reg6
GetReg "Reg=7"
reg7 = result
Say "Register7="reg7
These two also seem to be present:
Arexx template: Get "REG=REGISTER/K/N/A"
Arexx template: Set "REG=REGISTER/K/N/A,VALUE/N/A"
Set "Reg 7 Value" 56
Set "Reg 7" 56
GetReg "Reg=7"
reg7 = result
Say "Register7="reg7
McpMsg GET NODE 1 ID 1
McpMsg SET NODE 1 ID 1 VAR 1
WriteString
This command can be used to change Text, Stringgadget and Button
Objects however, Button objects need a little work.
Arexx template: WriteString "ID/N/A,STRING/F"
WriteString "ID 12 STRING text"
WriteString "12 text"
McpMsg WRITESTRING NODE 1 ID 1 STRING "string"
ReadString
This command can be used to read a string from StringGadgets
Arexx template: ReadString "ID/N/A"
ReadString "ID 12"
ReadString "12"
McpMsg READSTRING NODE 1 ID 1
ReadState
This command can be used to read the state of a CheckMark object
Arexx template: ReadState "ID/N/A"
ReadState "ID 3"
ReadState "3"
McpMsg READSTATE NODE 1 ID 1
ChangeState CheckMark
This command can be used to change the state of a CheckMark object
Arexx template: ChangeState "ID/N/A,STATE/N"
ChangeState "ID 4 STRING" State
ChangeState "4" State
McpMsg CHANGESTATE NODE 1 ID 1 VAR 0/1
EmptyList
This command can be used to empty a list object.
Arexx template: EmptyList "ID/N/A"
EmptyList "ID 6"
EmptyList "6"
McpMsg EMPTYLIST NODE 1 ID 1
AddToList
This command can be used to add lines to list objects.
This command will install two strings for each object
in a list. The first one is the text that is displayed.
The second one is the program executed when you click on
the item in the list.
Note that in the Arexx example underscores are used.
I couldn't find a way to get two strimgs with spaces in
them to the program. So you need to replace spaces with
underscores. The program will remove the underscores.
Note that this is not a problem with the McpMsg program,
however if a string contains spaces you need to place
it between "" on the command line.
Arexx template: AddToList "ID/N/A,STRING/A,RUN/A"
AddToList "ID 6 STRING list_tst RUN test_tst"
AddToList "6 list_tst test_tst"
McpMsg ADDTOLIST NODE 1 ID 1 STRING "list tst" RUN "test tst"
ClearList
This command can be used to unselect all selected items in lists
Arexx template: ClearList "ID/N/A"
GetFirstItem, GetNextItem
Read the selected Items of a list
Note that the GetItem commands reads the invisible/second string,
which normally is the "run" string.
This is done so you can add FI a file size to the name in the
visible field, but only have the clean name in the invisible field.
So you need to fill both fields.
Note that rc=0 if there is a string, and rc=1 if there is no
string. I tried to make this the line number, and 65535 for no line
but the interpreter didn't like it very much.
Arexx template: GetFirstItem "ID/N/A"
Arexx template: GetNextItem "ID/N/A"
Examples:
/* copy selected items to other list */
end = 0
GetFirstItem 10
end = rc
str = result
do while end = 0
AddToList "20" str "test"
GetNextItem 10
end = rc
str = result
end
Quit
Quit the MCP program
Arexx template: Quit ""
Quit
Pause
Creates a pause in the Arexx script.
Note the time is in 1/50th seconds. So 50 is one second.
Use it wisely, because it blocks the program while
pausing. You could use it if you want to display text before
usind the Quit command.
Arexx template: Pause "TIME/N/A"
Pause 100 /* pause of 2 seconds */